All Pages

3D Space Flight Demo ▪ 3D Space Flight Demo
▪ Making of Space Flight Demo
Mini Projects ▪ Minecraft Mapper
▪ Pennies From Heaven
▪ The Number One Biggest Fan
▪ HTML-based File Explorer Project
▪ The Website Remake
Max
Anderson

HTML-based File Explorer

Last week I was brainstorming new and cool ways someone could make a website that is different from the rest. I had the idea of a website where you navigate a file system, and the pages are all files.

A branching file system with icons.

(here I've altered the color scheme for better contrast with the rest of the website, so people don't get confused)

I eventually got to work, but about halfway through I realized that I was not writing some novel website design, I was just writing a file explorer. I pressed on, creating a tree of files using recursive functions. I drew icons for images, documents, and folders.

Once I had the backend done, it was time for CSS. I had to fiddle a lot with margins and line spacing to get everything even, but I got there in the end. It was looking pretty good, and exactly as I had envisioned.

About the Final Product

What I ended up with was an HTML-based file explorer that let me view entire file trees from anywhere in my system. The root folder could be dynamically adjusted in the URL, and every single folder was expandable. The backend is in python3 and flask, but I only used flask for the serving. I constructed the HTML string myself rather than using flask's jinja templates.

It runs decently fast even for large file structures with lots of subfolders. All of the recursion is done at page load, so I'd imagine there is some optimization to be done there.

With some cleaning up, I could release the code. It definitely still needs more icons, and potentially some way to view certain filetypes as well. Some of the methods I used to construct the strings are pretty scuffed. A built in image or text or even markdown viewer would be super cool.

Created: 2026-11-13 16:50:44

Copyright ©2026 All Rights Reserved.